<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next-haha.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next-haha.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next-haha.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.0/css/all.min.css" integrity="sha256-VHqXKFhhMxcpubYf9xiWdCiojEbY9NexQ4jh8AxbvcM=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"ming.theyan.gs","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.25.0","exturl":false,"sidebar":{"position":"left","width_expanded":320,"width_dual_column":240,"display":"post","padding":18,"offset":12},"hljswrap":true,"codeblock":{"theme":{"light":"default","dark":"stackoverflow-dark"},"prism":{"light":"prism","dark":"prism-dark"},"copy_button":{"enable":false,"style":null},"fold":{"enable":false,"height":500},"language":false},"bookmark":{"enable":true,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"duration":200,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"top_n_per_article":1,"unescape":false,"preload":false,"trigger":"auto"}}</script><script src="/js/config.js" defer></script>

    <meta name="description" content="缘起最近上面在开会嘛，职能部门也许是要展示下“肌肉”：“不是我搞不了你，我只是平时懒得鸟你。”我猜大概就是这么个原因吧，结果就是：最近这段时间大家的“科学上网”纷纷中招，不好使了。我司原来用的 SS 改良的版本，中招了，至于怎么解决的，不在本篇讨论的范围之内。 我主要说下家里的情况，家里原来也是 SS 方案，这段时间也不行了，通常是早上不通了，改下端口，然后到晚上又不行了，然后又改端口，搞了两次才">
<meta property="og:type" content="article">
<meta property="og:title" content="科学上网之 SSR 方案">
<meta property="og:url" content="https://ming.theyan.gs/2017/10/%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91%E4%B9%8B-SSR-%E6%96%B9%E6%A1%88/index.html">
<meta property="og:site_name" content="运维烂笔头">
<meta property="og:description" content="缘起最近上面在开会嘛，职能部门也许是要展示下“肌肉”：“不是我搞不了你，我只是平时懒得鸟你。”我猜大概就是这么个原因吧，结果就是：最近这段时间大家的“科学上网”纷纷中招，不好使了。我司原来用的 SS 改良的版本，中招了，至于怎么解决的，不在本篇讨论的范围之内。 我主要说下家里的情况，家里原来也是 SS 方案，这段时间也不行了，通常是早上不通了，改下端口，然后到晚上又不行了，然后又改端口，搞了两次才">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2017-10-21T07:12:23.000Z">
<meta property="article:modified_time" content="2017-10-21T07:12:23.000Z">
<meta property="article:author" content="老杨">
<meta property="article:tag" content="Docker">
<meta property="article:tag" content="科学上网">
<meta property="article:tag" content="Shadowsocks">
<meta property="article:tag" content="ShadowsocksR">
<meta property="article:tag" content="SS">
<meta property="article:tag" content="SSR">
<meta property="article:tag" content="OpenWrt">
<meta property="article:tag" content="pdnsd">
<meta property="article:tag" content="dnsmasq-full">
<meta property="article:tag" content="Xenial">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://ming.theyan.gs/2017/10/%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91%E4%B9%8B-SSR-%E6%96%B9%E6%A1%88/">


<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://ming.theyan.gs/2017/10/%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91%E4%B9%8B-SSR-%E6%96%B9%E6%A1%88/index.html","path":"2017/10/科学上网之-SSR-方案/index.html","title":"科学上网之 SSR 方案"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>科学上网之 SSR 方案 | 运维烂笔头</title>
  
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-106574959-2"></script>
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-106574959-2","only_pageview":false,"measure_protocol_api_secret":null}</script>
  <script src="/js/third-party/analytics/google-analytics.js" defer></script>

  <script src="/js/third-party/analytics/baidu-analytics.js" defer></script>
  <script async src="https://hm.baidu.com/hm.js?fdef9ded31bdb8b2dab08eddebdd5fed"></script>







  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous" defer></script>
<script src="/js/utils.js" defer></script><script src="/js/motion.js" defer></script><script src="/js/sidebar.js" defer></script><script src="/js/next-boot.js" defer></script><script src="/js/bookmark.js" defer></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.5.0/search.js" integrity="sha256-xFC6PJ82SL9b3WkGjFavNiA9gm5z6UBxWPiu4CYjptg=" crossorigin="anonymous" defer></script>
<script src="/js/third-party/search/local-search.js" defer></script>







  




<!-- google adsense -->
<script data-ad-client="ca-pub-1045025618858716" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<link rel="alternate" href="/atom.xml" title="运维烂笔头" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">运维烂笔头</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">一个 SA 老兵的工作日志</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-projects"><a href="/projects" rel="section"><i class="fa fa-code fa-fw"></i>projects</a></li><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li><li class="menu-item menu-item-sitemap"><a href="/sitemap.xml" rel="section"><i class="fa fa-sitemap fa-fw"></i>站点地图</a></li><li class="menu-item menu-item-commonweal"><a href="/404/" rel="section"><i class="fa fa-heartbeat fa-fw"></i>公益 404</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
      <div class="search-header">
        <span class="search-icon">
          <i class="fa fa-search"></i>
        </span>
        <div class="search-input-container">
          <input autocomplete="off" autocapitalize="off" maxlength="80"
                placeholder="搜索..." spellcheck="false"
                type="search" class="search-input">
        </div>
        <span class="popup-btn-close" role="button">
          <i class="fa fa-times-circle"></i>
        </span>
      </div>
      <div class="search-result-container">
        <div class="search-result-icon">
          <i class="fa fa-spinner fa-pulse fa-5x"></i>
        </div>
      </div>
    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E7%BC%98%E8%B5%B7"><span class="nav-number">1.</span> <span class="nav-text">缘起</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E7%8E%B0%E6%9C%89%E8%B5%84%E6%BA%90"><span class="nav-number">2.</span> <span class="nav-text">现有资源</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#SSR-%E6%96%B9%E6%A1%88"><span class="nav-number">3.</span> <span class="nav-text">SSR 方案</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#VPS-%E7%AB%AF"><span class="nav-number">3.1.</span> <span class="nav-text">VPS 端</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Server-%E7%AB%AF%E9%83%A8%E7%BD%B2"><span class="nav-number">3.1.1.</span> <span class="nav-text">Server 端部署</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#OpenWrt-%E7%AB%AF"><span class="nav-number">3.2.</span> <span class="nav-text">OpenWrt 端</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Client-%E7%AB%AF%E9%83%A8%E7%BD%B2"><span class="nav-number">3.2.1.</span> <span class="nav-text">Client 端部署</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Client-%E7%AB%AF%E9%85%8D%E7%BD%AE"><span class="nav-number">3.2.2.</span> <span class="nav-text">Client 端配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Client-%E7%AB%AF%E5%90%AF%E5%8A%A8"><span class="nav-number">3.2.3.</span> <span class="nav-text">Client 端启动</span></a></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">老杨</p>
  <div class="site-description" itemprop="description">好记性比不过烂笔头</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">114</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">8</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">509</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/haw-haw" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;haw-haw" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:blog@theyan.gs" title="E-Mail → mailto:blog@theyan.gs" rel="noopener me" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://weibo.com/u/1494877243" title="Weibo → https:&#x2F;&#x2F;weibo.com&#x2F;u&#x2F;1494877243" rel="noopener me" target="_blank"><i class="fab fa-weibo fa-fw"></i>Weibo</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://twitter.com/6fool" title="Twitter → https:&#x2F;&#x2F;twitter.com&#x2F;6fool" rel="noopener me" target="_blank"><i class="fab fa-twitter fa-fw"></i>Twitter</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
    <div class="sidebar-inner sidebar-blogroll">
      <div class="links-of-blogroll animated">
        <div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
          链接
        </div>
        <ul class="links-of-blogroll-list">
            <li class="links-of-blogroll-item">
              <a href="https://bad-pencil.github.io/" title="https:&#x2F;&#x2F;bad-pencil.github.io" rel="noopener" target="_blank">github 镜像站</a>
            </li>
            <li class="links-of-blogroll-item">
              <a href="https://hawhaw.gitee.io/" title="https:&#x2F;&#x2F;hawhaw.gitee.io" rel="noopener" target="_blank">gitee 镜像站</a>
            </li>
        </ul>
      </div>
    </div>
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2017/10/%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91%E4%B9%8B-SSR-%E6%96%B9%E6%A1%88/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="科学上网之 SSR 方案 | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          科学上网之 SSR 方案
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2017-10-21 15:12:23" itemprop="dateCreated datePublished" datetime="2017-10-21T15:12:23+08:00">2017-10-21</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><h1 id="缘起"><a href="#缘起" class="headerlink" title="缘起"></a>缘起</h1><p>最近上面在开会嘛，职能部门也许是要展示下“肌肉”：“不是我搞不了你，我只是平时懒得鸟你。”我猜大概就是这么个原因吧，结果就是：最近这段时间大家的“科学上网”纷纷中招，不好使了。我司原来用的 SS 改良的版本，中招了，至于怎么解决的，不在本篇讨论的范围之内。</p>
<p>我主要说下家里的情况，家里原来也是 SS 方案，这段时间也不行了，通常是早上不通了，改下端口，然后到晚上又不行了，然后又改端口，搞了两次才是反应过来是被盯上了。心中大呼侥幸！这要是不封端口直接封 IP 我可咋整呀？！就冲这点来讲不得不说职能部门真是良心单位哈，值得点个赞！</p>
<h1 id="现有资源"><a href="#现有资源" class="headerlink" title="现有资源"></a>现有资源</h1><ul>
<li>米国 VPS 一台（Ubuntu 16.04）</li>
<li>家里路由器一台（OpenWrt 14.07，bcrm63xx 架构）</li>
</ul>
<p>以前也是这情况，不过以前跑的是 SS，据说 SSR 比 SS 更不容易被 ban，所以这次我的方案是用 SSR 替换掉原来的 SS。</p>
<a id="more"></a>
<h1 id="SSR-方案"><a href="#SSR-方案" class="headerlink" title="SSR 方案"></a>SSR 方案</h1><p>具体（替换）过程这里不赘述了，中间来来回回走过不少弯路，说起来都是泪呀，只谈下最终的方案的情况吧，这也是我推荐的方案。</p>
<h2 id="VPS-端"><a href="#VPS-端" class="headerlink" title="VPS 端"></a>VPS 端</h2><p>VPS 上起 Docker 服务，然后直接拉一个 SSR 的 Docker image 来跑。</p>
<h3 id="Server-端部署"><a href="#Server-端部署" class="headerlink" title="Server 端部署"></a>Server 端部署</h3><p>这里的部署文档参考了：DigitalOcean 的 <a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04" title="How To Install and Use Docker on Ubuntu 16.04" target="_blank" rel="noopener">How To Install and Use Docker on Ubuntu 16.04</a> 和 Docker 官方的 <a href="https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/" title="Get Docker CE for Ubuntu" target="_blank" rel="noopener">Get Docker CE for Ubuntu</a></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 删除掉以前的 Docker，至于为什么用 purge 而不是 remove，自己想</span></span><br><span class="line">apt-get purge docker docker-engine docker.io;</span><br><span class="line"></span><br><span class="line">apt-get update;</span><br><span class="line">apt-get install \</span><br><span class="line">    apt-transport-https \</span><br><span class="line">    ca-certificates \</span><br><span class="line">    curl \</span><br><span class="line">    software-properties-common;</span><br><span class="line"></span><br><span class="line"><span class="comment"># 添加 Docker 官方的 GPG key</span></span><br><span class="line">curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -;</span><br><span class="line"></span><br><span class="line"><span class="comment"># 新增 Docker 的官方 repo</span></span><br><span class="line">add-apt-repository \</span><br><span class="line">   <span class="string">"deb [arch=amd64] https://download.docker.com/linux/ubuntu \</span></span><br><span class="line"><span class="string">   <span class="variable">$(lsb_release -cs)</span> \</span></span><br><span class="line"><span class="string">   stable"</span>;</span><br><span class="line">   </span><br><span class="line">apt-get update;</span><br><span class="line"></span><br><span class="line"><span class="comment"># 安装 Docker（Docker 新版叫 docker-ce）</span></span><br><span class="line">apt-get install docker-ce;</span><br><span class="line"></span><br><span class="line"><span class="comment"># 拉一个 SSR 的 Docker（image） 跑起来</span></span><br><span class="line">docker run -p 11402:51348 \</span><br><span class="line">	--restart=always \</span><br><span class="line">	--name=SSR \</span><br><span class="line">	-e PASSWORD=xxxxxxxxxxx \</span><br><span class="line">	-d breakwa11/shadowsocksr;</span><br></pre></td></tr></table></figure>
<p>需要注意的是，上面跑的这个 Docker image，其实是有很多隐含参数的，如果不知道，SSR 客户端是没法连过来的，具体详见 <a href="https://hub.docker.com/r/breakwa11/shadowsocksr/~/dockerfile/" title="Dockerfile for breakwa11/shadowsocksr" target="_blank" rel="noopener">Docker image:breakwa11/shadowsocksr 的 Dockerfile 文件</a>。考虑到被职能部门 ban 的可能性，我把缺省参数贴出来：</p>
<blockquote>
<p>ENV SERVER_ADDR     0.0.0.0<br>ENV SERVER_PORT     51348<br>ENV PASSWORD        psw<br>ENV METHOD          aes-128-ctr<br>ENV PROTOCOL        auth_aes128_md5<br>ENV PROTOCOLPARAM   32<br>ENV OBFS            tls1.2_ticket_auth_compatible<br>ENV TIMEOUT         300<br>ENV DNS_ADDR        8.8.8.8<br>ENV DNS_ADDR_2      8.8.4.4   </p>
</blockquote>
<h2 id="OpenWrt-端"><a href="#OpenWrt-端" class="headerlink" title="OpenWrt 端"></a>OpenWrt 端</h2><p>家里的 OpenWrt 上肯定是跑 SSR 的客户端，由于种种原因（主要是测试时服务器用的是 aws，当时貌似不支持 udp 转发），最终域名解析用了 pdnsd 的方案而不是 tunnel 方案。</p>
<h3 id="Client-端部署"><a href="#Client-端部署" class="headerlink" title="Client 端部署"></a>Client 端部署</h3><p>在 <a href="https://github.com/bettermanbao/openwrt-shadowsocksR-libev-full/releases" target="_blank" rel="noopener">github</a> 上找了个 brcm63xx 的 ShadowsocksR for OpenWrt 的 ipk 包，下载地址在<a href="https://github.com/bettermanbao/openwrt-shadowsocksR-libev-full/releases/download/v2.4.5-5/shadowsocksR-libev-full_2.4.5-5_brcm63xx-generic.zip" target="_blank" rel="noopener">这里</a>，如果你的 OpenWrt 路由器是别的体系架构的话，也许这个页面里还能找到更新一点的版本。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 删除掉 dnsmasq（如果已安装的话），因为需要安装 dnsmasq-full</span></span><br><span class="line">opkg remove dnsmasq;</span><br><span class="line"></span><br><span class="line"><span class="comment"># 安装 pdnsd 和 dnsmasq-full，此方案里有用到</span></span><br><span class="line">opkg install pdnsd dnsmasq-full;</span><br><span class="line"></span><br><span class="line"><span class="comment"># 不要自动启动 pdnsd，ShadowsockR 会将其起起来</span></span><br><span class="line">/etc/init.d/pdnsd <span class="built_in">disable</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment"># 下载 ShadowsocksR 软件包</span></span><br><span class="line">wget https://github.com/bettermanbao/openwrt-shadowsocksR-libev-full/releases/download/v2.4.5-5/shadowsocksR-libev-full_2.4.5-5_brcm63xx-generic.zip;</span><br><span class="line">unzip shadowsocksR-libev-full_2.4.5-5_brcm63xx-generic.zip;</span><br><span class="line"><span class="built_in">cd</span> shadowsocksR-libev-full_2.4.5-5_brcm63xx-generic;</span><br><span class="line"></span><br><span class="line"><span class="comment"># 下面这步是安装，如果依赖什么包没装，就 opkg install 安装后再继续</span></span><br><span class="line">opkg install \</span><br><span class="line">	shadowsocksr-libev-server-polarssl_2.4.5-5_brcm63xx.ipk;</span><br></pre></td></tr></table></figure>
<h3 id="Client-端配置"><a href="#Client-端配置" class="headerlink" title="Client 端配置"></a>Client 端配置</h3><p>SSR Client 的参数配置参照上面服务器的配置即可，但是有两点区别：</p>
<ol>
<li>PROTOCOLPARAM 参数可以留空不配</li>
<li>OBFS 配成 tls1.2_ticket_auth 即可</li>
</ol>
<p>客户端的配置工作可以在 web 界面来做，而且也推荐这么做</p>
<h3 id="Client-端启动"><a href="#Client-端启动" class="headerlink" title="Client 端启动"></a>Client 端启动</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">/etc/init.d/shadowsocksr start;</span><br><span class="line"><span class="comment"># 服务的启动也可以在 web 界面来做，推荐这样做，因为简单。</span></span><br></pre></td></tr></table></figure>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="reward-container">
  <div>请我一杯咖啡吧！</div>
  <button>
    赞赏
  </button>
  <div class="post-reward">
      <div>
        <img src="/images/wechat-reward.png" alt="老杨 微信">
        <span>微信</span>
      </div>
      <div>
        <img src="/images/alipay-reward.png" alt="老杨 支付宝">
        <span>支付宝</span>
      </div>

  </div>
</div>

          <div class="followme">
  <span>欢迎关注我的其它发布渠道</span>

  <div class="social-list">

      <div class="social-item">
          <a target="_blank" class="social-link" href="https://twitter.com/6fool">
            <span class="icon">
              <i class="fab fa-twitter"></i>
            </span>

            <span class="label">Twitter</span>
          </a>
      </div>

      <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
      </div>
  </div>
</div>

          <div class="post-tags">
              <a href="/tags/Docker/" rel="tag"># Docker</a>
              <a href="/tags/%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91/" rel="tag"># 科学上网</a>
              <a href="/tags/Shadowsocks/" rel="tag"># Shadowsocks</a>
              <a href="/tags/ShadowsocksR/" rel="tag"># ShadowsocksR</a>
              <a href="/tags/SS/" rel="tag"># SS</a>
              <a href="/tags/SSR/" rel="tag"># SSR</a>
              <a href="/tags/OpenWrt/" rel="tag"># OpenWrt</a>
              <a href="/tags/pdnsd/" rel="tag"># pdnsd</a>
              <a href="/tags/dnsmasq-full/" rel="tag"># dnsmasq-full</a>
              <a href="/tags/Xenial/" rel="tag"># Xenial</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2017/08/%E7%94%A8%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%94%9F%E6%88%90%E5%AD%97%E7%AC%A6%E7%BB%84%E6%88%90%E7%9A%84%E4%BA%8C%E7%BB%B4%E7%A0%81/index.html" rel="prev" title="用命令行生成字符组成的二维码">
                  <i class="fa fa-angle-left"></i> 用命令行生成字符组成的二维码
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2017/12/Linux%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%86%85%E7%BD%91%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90%E4%BC%98%E5%8C%96%E6%96%B9%E6%A1%88/index.html" rel="next" title="Linux 服务器内网域名解析优化方案">
                  Linux 服务器内网域名解析优化方案 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">老杨</span>
  </div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>
  <div class="sidebar-dimmer"></div>
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>

</body>
</html>
